package com.banmoon.decorator.optimize;


import com.banmoon.decorator.optimize.coffee.Espresso;
import com.banmoon.decorator.optimize.coffee.LongBlack;
import com.banmoon.decorator.optimize.dosing.Chocolate;
import com.banmoon.decorator.optimize.dosing.Milk;
import com.banmoon.decorator.optimize.dosing.Sugar;

public class CoffeeShopMain {

    public static void main(String[] args) {
        Drink longBlack = new LongBlack();
        longBlack = new Milk(longBlack);
        longBlack = new Sugar(longBlack);
        System.out.println(longBlack.getDesc());
        System.out.println("金额是：" + longBlack.cost());

        System.out.println("==================== 分割线 ====================");
        Drink espresso = new Espresso();
        espresso = new Milk(espresso);
        espresso = new Sugar(espresso);
        espresso = new Chocolate(espresso);
        espresso = new Chocolate(espresso);// 点两份巧克力
        System.out.println(espresso.getDesc());
        System.out.println("金额是：" + espresso.cost());
    }
}
